#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(ll i = (x); i <= (y); i++)
#define per(i, x, y) for(ll i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using tl = tuple < int, int, int >;
using vec = vector < int >;
using veg = vector < pii >;

ll read() {
    ll x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 22;
const int mod = 1e9 + 7;

ll S, f[N];
int n, inv[N], ans;

int C(ll x, ll y) {
	if(x < y || x < 0 || y < 0) return 0;
	int res = 1;
	per(i, x, x - y + 1) res = 1ll * res * (i % mod) % mod;
	res = 1ll * res * inv[y] % mod; return res;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
	n = in; inv[1] = 1; rep(i, 2, n) inv[i] = 1ll * inv[mod % i] * (mod - mod / i) % mod;
	inv[0] = 1; rep(i, 1, n) inv[i] = 1ll * inv[i - 1] * inv[i] % mod;
	S = in; rep(i, 0, n - 1) f[i] = in;
	int U = 1 << n; U--; 
	rep(s, 0, U) {
		ll tot = S; int cnt = 0;
		rep(i, 0, n - 1)
			if(s >> i & 1) cnt++, tot -= f[i] + 1;
		if(cnt & 1) ans = (ans - C(tot + n - 1, n - 1) + mod) % mod;
		else ans = (ans + C(tot + n - 1, n - 1)) % mod;
	} printf("%d\n", ans);
	return 0;
}
